﻿Public Class ConfigurationElementCollection
  Inherits Configuration.ConfigurationElementCollection

  Default Public Shadows Property Item(ByVal index As Integer) As Core.ConfigurationElement
    Get
      Return CType(BaseGet(index), Core.ConfigurationElement)
    End Get
    Set(ByVal value As Core.ConfigurationElement)
      If Not (BaseGet(index) Is Nothing) Then
        Call BaseRemoveAt(index)
      End If
      Call BaseAdd(index, value)
    End Set
  End Property

  Protected Overloads Overrides Function CreateNewElement() As System.Configuration.ConfigurationElement
    Return New Core.ConfigurationElement
  End Function

  Protected Overrides Function GetElementKey(ByVal element As System.Configuration.ConfigurationElement) As Object
    Return CType(element, Core.ConfigurationElement).Name
  End Function

  Public Sub Add(ByVal element As Core.ConfigurationElement)
    Call MyBase.BaseAdd(element, True)
  End Sub

  Default Public Shadows ReadOnly Property Item(ByVal Name As String) As ConfigurationElement
    Get
      Return CType(BaseGet(Name), ConfigurationElement)
    End Get
  End Property

  Public Function IndexOf(ByVal role As ConfigurationElement) As Integer
    Return BaseIndexOf(role)
  End Function

  Public Sub Clear()
    BaseClear()
  End Sub
End Class
